bitkeeper revision 1.1159.1.439 (419e8535rE43ZEqB5g-cVo09BFHZwQ)
authorcl349@arcadians.cl.cam.ac.uk <cl349@arcadians.cl.cam.ac.uk>
Fri, 19 Nov 2004 23:43:49 +0000 (23:43 +0000)
committercl349@arcadians.cl.cam.ac.uk <cl349@arcadians.cl.cam.ac.uk>
Fri, 19 Nov 2004 23:43:49 +0000 (23:43 +0000)
sync w/ head.

1  2 
.rootkeys
linux-2.6.9-xen-sparse/arch/xen/kernel/Makefile
linux-2.6.9-xen-sparse/arch/xen/kernel/evtchn.c
xen/arch/x86/domain.c
xen/arch/x86/memory.c
xen/arch/x86/setup.c
xen/arch/x86/shadow.c
xen/arch/x86/traps.c
xen/common/physdev.c
xen/include/asm-x86/processor.h
xen/include/xen/sched.h

diff --cc .rootkeys
Simple merge
index 65817ef5956285c476b19cb1bf2d0924a20b48db,3e987bee23d2cf2bcca026047a8a26caf170b147..c782becc7eb0907ec89f2cabcb8306b63ffb0c74
@@@ -9,5 -9,4 +9,5 @@@ $(obj)/vmlinux.lds
  
  extra-y += vmlinux.lds
  
- obj-y := ctrl_if.o evtchn.o fixup.o reboot.o xen_proc.o empty.o \
 -obj-y := ctrl_if.o evtchn.o fixup.o reboot.o xen_proc.o gnttab.o skbuff.o
++obj-y := ctrl_if.o evtchn.o fixup.o reboot.o xen_proc.o \
 +           gnttab.o skbuff.o smp.o
Simple merge
index 0e295e6df4c31c92e64b4aab07ac8fe4ef694e6f,d9d10ca29a9e0e1cbd6f435967f662efa484337e..08757113e48159cc5519ccc1baa9b7b40a072375
@@@ -1844,10 -1809,7 +1844,9 @@@ int ptwr_do_page_fault(unsigned long ad
          domain_crash();
      }
      
-     /* Maybe fall through to shadow mode to propagate writable L1. */
-     return !current->mm.shadow_mode;
 +    UNLOCK_BIGLOCK(d);
 +
+     return EXCRET_fault_fixed;
  }
  
  static __init int ptwr_init(void)
Simple merge
Simple merge
index dce0b7d736566fc95e9e30cc4888b5b1d1744ee9,29fb3a66e05c7b87cdbce7bfa02d0a2675e45e9d..8fd3295e49a64c1f1a13e8b2df98c07f64fb59d3
@@@ -248,8 -248,8 +248,8 @@@ static inline int do_trap(int trapnr, c
      tb->cs         = ti->cs;
      tb->eip        = ti->address;
      if ( TI_GET_IF(ti) )
 -        d->shared_info->vcpu_data[0].evtchn_upcall_mask = 1;
 +        ed->vcpu_info->evtchn_upcall_mask = 1;
-     return
+     return 0;
  
   xen_fault:
  
@@@ -292,10 -293,10 +293,10 @@@ DO_ERROR_NOCODE(16, "fpu error", coproc
  DO_ERROR(17, "alignment check", alignment_check)
  DO_ERROR_NOCODE(19, "simd error", simd_coprocessor_error)
  
- asmlinkage void do_int3(struct xen_regs *regs, long error_code)
+ asmlinkage int do_int3(struct xen_regs *regs, long error_code)
  {
 -    struct domain *d = current;
 -    struct trap_bounce *tb = &d->thread.trap_bounce;
 +    struct exec_domain *ed = current;
 +    struct trap_bounce *tb = &ed->thread.trap_bounce;
      trap_info_t *ti;
  
      DEBUGGER_trap_entry(TRAP_int3, regs, error_code);
      tb->cs         = ti->cs;
      tb->eip        = ti->address;
      if ( TI_GET_IF(ti) )
 -        d->shared_info->vcpu_data[0].evtchn_upcall_mask = 1;
 +        ed->vcpu_info->evtchn_upcall_mask = 1;
+     return 0;
  }
  
  asmlinkage void do_double_fault(void)
@@@ -378,36 -379,35 +381,40 @@@ asmlinkage int do_page_fault(struct xen
               unlikely((addr >> L2_PAGETABLE_SHIFT) ==
                        ptwr_info[cpu].ptinfo[PTWR_PT_ACTIVE].l2_idx) )
          {
 +            LOCK_BIGLOCK(d);
              ptwr_flush(PTWR_PT_ACTIVE);
-             return;
 +            UNLOCK_BIGLOCK(d);
+             return EXCRET_fault_fixed;
          }
  
          if ( (addr < PAGE_OFFSET) &&
               ((error_code & 3) == 3) && /* write-protection fault */
               ptwr_do_page_fault(addr) )
-             return;
+         {
+             if ( unlikely(d->mm.shadow_mode) )
+                 (void)shadow_fault(addr, error_code);
+             return EXCRET_fault_fixed;
+         }
      }
  
 -    if ( unlikely(d->mm.shadow_mode) && 
 +    if ( unlikely(ed->mm.shadow_mode) && 
           (addr < PAGE_OFFSET) && shadow_fault(addr, error_code) )
-         return; /* Returns TRUE if fault was handled. */
+         return EXCRET_fault_fixed;
  
 -    if ( unlikely(addr >= LDT_VIRT_START) && 
 -         (addr < (LDT_VIRT_START + (d->mm.ldt_ents*LDT_ENTRY_SIZE))) )
 +    if ( unlikely(addr >= LDT_VIRT_START(ed)) && 
 +         (addr < (LDT_VIRT_START(ed) + (ed->mm.ldt_ents*LDT_ENTRY_SIZE))) )
      {
          /*
           * Copy a mapping from the guest's LDT, if it is valid. Otherwise we
           * send the fault up to the guest OS to be handled.
           */
 -        off  = addr - LDT_VIRT_START;
 -        addr = d->mm.ldt_base + off;
 -        if ( likely(map_ldt_shadow_page(off >> PAGE_SHIFT)) )
 +        LOCK_BIGLOCK(d);
 +        off  = addr - LDT_VIRT_START(ed);
 +        addr = ed->mm.ldt_base + off;
 +        ret = map_ldt_shadow_page(off >> PAGE_SHIFT);
 +        UNLOCK_BIGLOCK(d);
 +        if ( likely(ret) )
-             return; /* successfully copied the mapping */
+             return EXCRET_fault_fixed; /* successfully copied the mapping */
      }
  
      if ( unlikely(!(regs->cs & 3)) )
      tb->cs         = ti->cs;
      tb->eip        = ti->address;
      if ( TI_GET_IF(ti) )
 -        d->shared_info->vcpu_data[0].evtchn_upcall_mask = 1;
 +        ed->vcpu_info->evtchn_upcall_mask = 1;
-     return; 
+     return 0
  
   xen_fault:
  
      if ( likely((fixup = search_exception_table(regs->eip)) != 0) )
      {
          perfc_incrc(copy_user_faults);
 -        if ( !d->mm.shadow_mode )
 +        if ( !ed->mm.shadow_mode )
              DPRINTK("Page fault: %08lx -> %08lx\n", regs->eip, fixup);
          regs->eip = fixup;
-         return;
+         return 0;
      }
  
      DEBUGGER_trap_fatal(TRAP_page_fault, regs, error_code);
            "[error_code=%08x]\n"
            "Faulting linear address might be %08lx\n",
            smp_processor_id(), error_code, addr);
+     return 0;
  }
  
- asmlinkage void do_general_protection(struct xen_regs *regs, long error_code)
+ asmlinkage int do_general_protection(struct xen_regs *regs, long error_code)
  {
 -    struct domain *d = current;
 -    struct trap_bounce *tb = &d->thread.trap_bounce;
 +    struct exec_domain *ed = current;
 +    struct domain *d = ed->domain;
 +    struct trap_bounce *tb = &ed->thread.trap_bounce;
      trap_info_t *ti;
      unsigned long fixup;
  
      tb->cs         = ti->cs;
      tb->eip        = ti->address;
      if ( TI_GET_IF(ti) )
 -        d->shared_info->vcpu_data[0].evtchn_upcall_mask = 1;
 +        ed->vcpu_info->evtchn_upcall_mask = 1;
-     return;
+     return 0;
  
   gp_in_kernel:
  
@@@ -583,13 -582,13 +590,13 @@@ static void nmi_softirq(void
          return;
  
      if ( test_and_clear_bit(0, &nmi_softirq_reason) )
 -        send_guest_virq(dom0, VIRQ_PARITY_ERR);
 +        send_guest_virq(dom0->exec_domain[0], VIRQ_PARITY_ERR);
  
      if ( test_and_clear_bit(1, &nmi_softirq_reason) )
 -        send_guest_virq(dom0, VIRQ_IO_ERR);
 +        send_guest_virq(dom0->exec_domain[0], VIRQ_IO_ERR);
  }
  
- asmlinkage void math_state_restore(struct xen_regs *regs, long error_code)
+ asmlinkage int math_state_restore(struct xen_regs *regs, long error_code)
  {
      /* Prevent recursion. */
      clts();
          tb->cs         = current->thread.traps[7].cs;
          tb->eip        = current->thread.traps[7].address;
      }
+     return EXCRET_fault_fixed;
  }
  
- asmlinkage void do_debug(struct xen_regs *regs, long error_code)
+ asmlinkage int do_debug(struct xen_regs *regs, long error_code)
  {
      unsigned int condition;
 -    struct domain *d = current;
 +    struct exec_domain *d = current;
      struct trap_bounce *tb = &d->thread.trap_bounce;
  
      DEBUGGER_trap_entry(TRAP_debug, regs, error_code);
Simple merge
Simple merge
index 25309b408a1b2f5683c865f763589d655ce544a9,d449f6bfaa5ae136a17a0d803693672c95d17a19..a336e35beb81e187ba4a339de77b12ff17509fb7
@@@ -137,15 -104,7 +137,7 @@@ struct domain 
      spinlock_t       pcidev_lock;
      struct list_head pcidev_list;
  
-     /* The following IO bitmap stuff is x86-dependent. */
-     u64 io_bitmap_sel; /* Selector to tell us which part of the IO bitmap are
-                         * "interesting" (i.e. have clear bits) */
-     /* Handy macro - number of bytes of the IO bitmap, per selector bit. */
- #define IOBMP_SELBIT_LWORDS (IO_BITMAP_SIZE / 64)
-     unsigned long *io_bitmap; /* Pointer to task's IO bitmap or NULL */
 -    unsigned long flags;
 +    unsigned long d_flags;
      unsigned long vm_assist;
  
      atomic_t refcnt;